unit uStubServidor;

interface

uses
  System.Win.scktcomp;

type
  TStubServidor = class
    private
      FSocketServidor : TServerSocket;
    public
      property SocketServidor : TServerSocket read FSocketServidor write FSocketServidor;
      procedure SocketServidorClientConnect(Sender: TObject; Socket: TCustomWinSocket);
      constructor create;
  end;

implementation

uses
  Vcl.Dialogs;

{ TStubServidor }

constructor TStubServidor.create;
begin
  SocketServidor := TServerSocket.Create(nil);
  SocketServidor.Port := 5000;
  SocketServidor.ServerType := stNonBlocking;
end;

procedure TStubServidor.SocketServidorClientConnect(Sender: TObject;
  Socket: TCustomWinSocket);
begin
  SocketServidor.OnClientConnect := SocketServidorClientConnect;
  ShowMessage('OPAAA');
end;

end.
